require 'digest/md5'

class User < DatabaseObject

  attr_accessor :id, :username, :password, :email

  def initialize(username, password, email)
    @id = $database.users.last.id + 1
    @username = username
    @password = self.set_password(password)
    @email = email
  end

  def set_password(password)
    @password = Digest::MD5.hexdigest(password)
  end

end
